Override takeValuesFromRequest:inContext: when you want to do one of the following:
In the first case, you can place your code before the message to super. In the second case, you must place your code after the message to super. For example, the following implementation of takeValuesFromRequest:inContext: records the kinds of browsers-user agents-from which requests are made:// WebScript example - takeValuesFromRequest:request inContext:context { id userAgent = [request headerForKey:@"user-agent"]; [self recordUserAgent:userAgent]; [super takeValuesFromRequest:request inContext:context]; }The following example performs postprocessing. It takes the values for the street, city, state, and zipCode variables and stores them in the address variable formatted as a standard mailing address.
// WebScript example - takeValuesFromRequest:request inContext:context { [super takeValuesFromRequest:request inContext:context]; address = [NSString stringWithFormat:@"%@\n%@, %@ %@", street, city, state, zipCode]; } // Java example public void takeValuesFromRequest(Request request, Context context) { super.takeValuesFromRequest(request, context); address = street + city + state + zipCode; }
Table of Contents
Next Section